/*
* 获得现场优先级
* */
public class ThreadDemoByPriority {
    public static void main(String[] args) throws InterruptedException {
        Thread thread=new Thread(new Runnable(){

            @Override
            public void run() {
                Thread t=Thread.currentThread();
                System.out.println("线程的优先级:"+t.getPriority());
            }
        });
        System.out.println("线程的优先级2:"+thread.getPriority());
        thread.start();
        Thread.sleep(500);
        System.out.println("线程的优先级3："+thread.getPriority());
    }
}
